#include "vertex.h"


vertex::vertex(void)
{
	x = 0;
	y = 0;
}

vertex::vertex(float in_x, float in_y)
{
	x = in_x;
	y = in_y;
}

vertex::~vertex(void)
{
}

vertex vertex::operator+ (AVector invect) {
	return vertex(x + invect.x, y + invect.y);
}

AVector vertex::operator- (vertex invert) {
	return AVector(x - invert.x, y - invert.y);
}

vertex vertex::operator/ (float scalar) {
	return vertex(x / scalar, y / scalar);
}

float vertex::distance(vertex vert) {

	float dist_x, dist_y;

	dist_x = x - vert.x;
	dist_y = y - vert.y;

	return sqrt((dist_x*dist_x)+(dist_y*dist_y));
}